Skip to content

test: Add datafusion.format.* configs test coverage#21355

Merged
alamb merged 1 commit intoapache:mainfrom
erenavsarogullari:datafusion_format_configs_tests
Apr 7, 2026
Merged

test: Add datafusion.format.* configs test coverage#21355
alamb merged 1 commit intoapache:mainfrom
erenavsarogullari:datafusion_format_configs_tests

Conversation

@erenavsarogullari
Copy link
Copy Markdown
Member

Which issue does this PR close?

Rationale for this change

Currently, DataFusion supports 9 datafusion.format.* configs but their test coverage seem to be missed so this issue aims to add comprehensive test coverage for them. This is follow-up to recent config framework improvements: #20372 and #20816.

What changes are included in this PR?

New test coverage is being added for datafusion.format.* configs.

Are these changes tested?

Yes, new test coverage is being added for datafusion.format.* configs.

Are there any user-facing changes?

No

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Apr 4, 2026
Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @erenavsarogullari -- I think these are nice improvements in coverage. It would be even nicer to get some functional coverage too if they don't yet exist

## Test datafusion.format.* configurations ##
#############################################
query T
SELECT name FROM information_schema.df_settings WHERE name LIKE 'datafusion.format.%' ORDER BY name
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to tests showing that they can be set/removed, how about also adding tests that run a function that is affected by them (e.g. select a date and then show that changing datafusion.format.date changes how they are displayed)?

Copy link
Copy Markdown
Member Author

@erenavsarogullari erenavsarogullari Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alamb Thanks for the review and yes, we also need to add more functional coverage as follows:
Expected Behavior:

statement ok
SET datafusion.format.date_format = '%d-%m-%Y'

query D
SELECT DATE '2024-03-15'
----
15-03-2024

statement ok
RESET datafusion.format.date_format

query D
SELECT DATE '2024-03-15'
----
2024-03-15

However, currently, sqllogictest framework does not support custom format updates and it runs the test with default format settings and the results as follows:
Current Behavior:

statement ok
SET datafusion.format.date_format = '%d-%m-%Y'

query D
SELECT DATE '2024-03-15'
----
Returns 2024-03-15 instead of 15-03-2024

The reason is that and sqllogictest framework needs to be extended in order to uptake format settings by SessionContext instead default format settings: https://github.com/apache/datafusion/blob/main/datafusion/sqllogictest/src/engines/datafusion_engine/normalize.rs#L239. I need to have a look on this. Does it make sense to be merged current PR and extend sqllogictest framework and adding remaining functional tests by follow-up PR? If so, i can create follow-up issue.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to have a look on this. Does it make sense to be merged current PR and extend sqllogictest framework and adding remaining functional tests by follow-up PR? If so, i can create follow-up issue.

Yes that is an excellent idea. I will do so. Thank you

Copy link
Copy Markdown
Member Author

@erenavsarogullari erenavsarogullari Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#21447 has been created to follow-up.

@erenavsarogullari erenavsarogullari changed the title test: Add datafusion.format.* configs test coverage test: Add datafusion.format.* configs test coverage Apr 5, 2026
@alamb alamb added this pull request to the merge queue Apr 7, 2026
Merged via the queue into apache:main with commit 7c3b22c Apr 7, 2026
32 checks passed
@erenavsarogullari erenavsarogullari deleted the datafusion_format_configs_tests branch April 7, 2026 16:37
Dandandan pushed a commit to Dandandan/arrow-datafusion that referenced this pull request Apr 8, 2026
## Which issue does this PR close?
- Closes apache#21354.

## Rationale for this change
Currently, DataFusion supports 9 `datafusion.format.*` configs but their
test coverage seem to be missed so this issue aims to add comprehensive
test coverage for them. This is follow-up to recent `config framework`
improvements: apache#20372 and
apache#20816.

## What changes are included in this PR?
New test coverage is being added for `datafusion.format.*` configs.

## Are these changes tested?
Yes, new test coverage is being added for `datafusion.format.*` configs.

## Are there any user-facing changes?
No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add datafusion.format.* configs test coverage

2 participants